# encoding=utf8
# author: allen@thecover.co
# create_time: 2024/9/10 15:01
# file: __init__.py

import os
from flask import Flask
from app.flask_config import STATIC_PATH


def create_app():
    _config = os.getenv('FLASK_CONFIG') or 'app.flask_config.ProdConfig'
    app = Flask(__name__, static_folder=STATIC_PATH)

    app.config['MAX_CONTENT_LENGTH'] = 20 * 1024 * 1024
    app.config.from_object(_config)

    return app

